﻿using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DataManager : MonoBehaviour
{
    public static DataManager instance;
    public Dictionary<ushort, BlockData> blockDic = new Dictionary<ushort, BlockData>();
    private void Awake()
    {
        instance = this;
    }
    // Use this for initialization
    void Start()
    {
        string blockStr = Resources.Load<TextAsset>("Data/BlockData").text;
        List<BlockData> blockList = JsonConvert.DeserializeObject<List<BlockData>>(blockStr);
        foreach (var item in blockList)
        {
            blockDic.Add(item.id, item);
        }
    }
    
}
